home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Dec 89 / 0172-Escaping nested Dial-Dec89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  956 b   |  31 lines  |  [TEXT/GEOL]

  1. Item    6245283                         7-Dec-89        02:48
  2.  
  3. From:   D5295                           Reseach SW Design, D Goldman,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    Escaping nested Dialogs
  8.  
  9. A small bug in TDialogView.DoKeyCommand:
  10.  
  11. If the Escape key is pressed, and if there is no dismisser item in the dialog,
  12. there may yet be a superview interested in the Escape. (In my case, the dialog
  13. is inside a scroller inside a ...<a few views here>... inside another dialog.)
  14.  
  15. The fix is easy:
  16.  
  17.    chEscape:
  18.    IF aKeyCode = kClearVirtualCode THEN
  19.    DoKeyCommand := INHERITED DoKeyCommand(ch, aKeyCode, info)
  20.    ELSE IF LONGINT(fCancelItem) <> LONGINT(kNoIdentifier) THEN
  21.    DoChoice(FindSubView(fCancelItem), mCancelKey)
  22.  
  23.    { this clause was forgotten in MacApp: }
  24.    else if fNextHandler <> NIL then
  25.    DoKeyCommand := fNextHandler.DoKeyCommand(ch, aKeyCode, info);
  26.  
  27. Did I do that correctly?
  28.  
  29. -- Dave Goldman
  30.  
  31.